import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
export default new Router({
    routes: [{
            path: '/',
            redirect: '/login'
        },

        {
            path: '/login',
            component: () =>
                import ( /* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: {
                title: '登录'
            }
        },
        {
            path: '*',
            redirect: '/404'
        },
        // {
        //     path: '/dashboard',
        //     component: () =>
        //         import ( /* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
        //     meta: {
        //         title: '系统首页'
        //     }
        // },
        {
            path: '/',
            component: () =>
                import ( /* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: {
                title: '自述文件'
            },
            children: [{
                    path: '/dashboard',
                    component: () =>
                        import ( /* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: {
                        title: '系统首页'
                    }
                },
                {
                    name: 'BigData',
                    path: 'BigData',
                    component: () =>
                        import ( /* webpackChunkName: "BigData" */ '../components/page/BigData.vue'),
                    meta: {
                        title: '数据大屏'
                    },
                },
                {
                    name: 'Data_Browse',
                    path: 'Data_Browse',
                    component: () =>
                        import ( /* webpackChunkName: "Data_Browse" */ '../components/page/Data_Browse.vue'),
                    meta: {
                        title: '数据浏览'
                    },
                }, {
                    name: 'System_Management',
                    path: 'System_Management',
                    component: () =>
                        import ( /* webpackChunkName: "System_Management" */ '../components/page/System_Management.vue'),
                    meta: {
                        title: '系统管理'
                    },
                    children: [{
                        name: 'DataDictManagement',
                        path: '/DataDictManagement',
                        component: () =>
                            import ( /* webpackChunkName: "DataDictManagement" */ '../components/page/systemManagement/DataDictManagement.vue'),
                        meta: {
                            title: '数据字典管理'
                        }
                    }, {
                        name: 'OrganizationalStruManagement',
                        path: '/OrganizationalStruManagement',
                        component: () =>
                            import ( /* webpackChunkName: "OrganizationalStruManagement" */ '../components/page/systemManagement/OrganizationalStruManagement.vue'),
                        meta: {
                            title: '组织结构管理'
                        }
                    }, {
                        name: 'UserManagement',
                        path: '/UserManagement',
                        component: () =>
                            import ( /* webpackChunkName: "UserManagement" */ '../components/page/systemManagement/UserManagement.vue'),
                        meta: {
                            title: '用户管理'
                        }
                    }, {
                        name: 'RoleManagement',
                        path: '/RoleManagement',
                        component: () =>
                            import ( /* webpackChunkName: "RoleManagement" */ '../components/page/systemManagement/RoleManagement.vue'),
                        meta: {
                            title: '角色管理'
                        }
                    }, {
                        name: 'RoleAuthorization',
                        path: '/RoleAuthorization',
                        component: () =>
                            import ( /* webpackChunkName: "RoleAuthorization" */ '../components/page/systemManagement/RoleAuthorization.vue'),
                        meta: {
                            title: '角色授权'
                        }
                    }]
                }, { //WellImport
                    name: 'WellImport',
                    path: 'WellImport',
                    component: () =>
                        import ( /* webpackChunkName: "System_Management" */ '../components/page/Well_Import.vue'),
                    meta: {
                        title: '数据导入'
                    },
                    children: []
                }, {
                    name: 'Statistical_Analysis',
                    path: 'Statistical_Analysis',
                    component: () =>
                        import ( /* webpackChunkName: "Statistical_Analysis" */ '../components/page/Statistical_Analysis.vue'),
                    meta: {
                        title: '统计分析'
                    },
                    children: [{
                        name: 'CementingQuality',
                        path: '/CementingQuality',
                        component: () =>
                            import ( /* webpackChunkName: "CementingQuality" */ '../components/page/statisticalAnalysis/CementingQuality.vue'),
                        meta: {
                            title: '固井质量查询'
                        }
                    }, {
                        name: 'CementingQualityPassRate',
                        path: '/CementingQualityPassRate',
                        component: () =>
                            import ( /* webpackChunkName: "CementingQualityPassRate" */ '../components/page/statisticalAnalysis/CementingQualityPassRate.vue'),
                        meta: {
                            title: '固井质量合格率查询'
                        }
                    }, {
                        name: 'AllCementingQualityPassRate',
                        path: '/AllCementingQualityPassRate',
                        component: () =>
                            import ( /* webpackChunkName: "AllCementingQualityPassRate" */ '../components/page/statisticalAnalysis/AllCementingQualityPassRate.vue'),
                        meta: {
                            title: '全井固井质量合格率查询'
                        }
                    },
                    // {
                    //     name: 'CementingWorkData',
                    //     path: '/CementingWorkData',
                    //     component: () =>
                    //         import ( /* webpackChunkName: "CementingWorkData" */ '../components/page/statisticalAnalysis/CementingWorkData.vue'),
                    //     meta: {
                    //         title: '固井作业数据查询'
                    //     }
                    // },
                    {
                        name: 'WorkNumberStatistics',
                        path: '/WorkNumberStatistics',
                        component: () =>
                            import ( /* webpackChunkName: "WorkNumberStatistics" */ '../components/page/statisticalAnalysis/WorkNumberStatistics.vue'),
                        meta: {
                            title: '作业数量统计'
                        }
                    },{
						name: 'DataContrast',
						path: '/DataContrast',
						component: () =>
						    import ( /* webpackChunkName: "DataContrast" */ '../components/page/statisticalAnalysis/DataContrast.vue'),
						meta: {
						    title: '数据对比',
							}
					}]
                }, {
                    name: 'Cementing_Quality',
                    path: 'Cementing_Quality',
                    component: () =>
                        import ( /* webpackChunkName: "Statistical_Analysis" */ '../components/page/Cementing_Quality.vue'),
                    meta: {
                        title: '固井质量'
                    },
                    children: [{
                            name: 'ConstructionQualityEvaluation',
                            path: '/ConstructionQualityEvaluation',
                            component: () =>
                                import ( /* webpackChunkName: "ConstructionQualityEvaluation" */ '../components/page/cementingQuality/ConstructionQualityEvaluation.vue'),
                            meta: {
                                title: '施工质量评价'
                            }
                        },
                        // {
                        //     name: 'CementingQualityentry',
                        //     path: '/CementingQualityentry',
                        //     component: () =>
                        //         import ( /* webpackChunkName: "LoggingDataEntry" */ '../components/page/cementingQuality/CementingQualityentry.vue'),
                        //     meta: {
                        //         title: '测井数据录入'
                        //     }
                        // },
                        {
                            name: 'QualityWarning',
                            path: '/QualityWarning',
                            component: () =>
                                import ( /* webpackChunkName: "QualityWarning" */ '../components/page/cementingQuality/QualityWarning.vue'),
                            meta: {
                                title: '质量预警'
                            }
                        },
                        {
                            name: 'CementPre',
                            path: '/CementPre',
                            component: () =>
                                import ( /* webpackChunkName: "QualityWarning" */ '../components/page/cementingQuality/CementPre.vue'),
                            meta: {
                                title: '固井预测'
                            }
                        },
                        {
                            name: 'NetWorkParameter',
                            path: '/NetWorkParameter',
                            component: () =>
                                import ( /* webpackChunkName: "NetWorkParameter" */ '../components/page/cementingQuality/NetWorkParameter.vue'),
                            meta: {
                                title: '灰色神经网络模型参数'
                            }
                        }
                    ]
                }, {
                    name: 'well',
                    path: '/well',
                    component: () =>
                        import ( /* webpackChunkName: "well" */ '../components/page/dataClassification/basicData/well.vue'),
                    meta: {
                        title: '数据管理-井眼' //数据管理--新模块（最新版本）
                    },
                    children: [{
                        name: 'WellPreparizatation',
                        path: '/WellPreparizatation',
                        component: () =>
                            import ( /* webpackChunkName: "WellPreparizatation" */ '../components/page/dataClassificationwell/WellPreparizatation.vue'),
                        meta: {
                            title: '井眼准备数据'
                        }
                    }, ]
                }, {
                    name: 'BaseWellData',
                    path: '/BaseWellData',
                    component: () =>
                        import ( /* webpackChunkName: "BaseWellData" */ '../components/page/dataClassificationwell/BaseWellData.vue'),
                    meta: {
                        title: '基本数据'
                    }
                }, {
                    name: 'BasicData',
                    path: '/BasicData',
                    component: () =>
                        import ( /* webpackChunkName: "BaseWellData" */ '../components/page/dataClassificationwell/BasicData.vue'),
                    meta: {
                        title: '详细基本数据'
                    }
                }, {
                    name: 'Data_Classification',
                    path: '/Data_Classification',
                    component: () =>
                        import ( /* webpackChunkName: "classification" */ '../components/page/Data_Classification.vue'),
                    meta: {
                        title: '数据管理'
                    },
                    children: [{
                        name: 'well_structure',
                        path: '/well_structure',
                        component: () =>
                            import ( /* webpackChunkName: "well_structure" */ '../components/page/dataClassification/basicData/well_structure.vue'),
                        meta: {
                            title: '井身结构'
                        }
                    }, {
                        name: 'stratum',
                        path: '/stratum',
                        component: () =>
                            import ( /* webpackChunkName: "stratum" */ '../components/page/dataClassification/basicData/stratum.vue'),
                        meta: {
                            title: '地层温度压力'
                        }
                    }, {
                        name: 'mud_property',
                        path: '/mud_property',
                        component: () =>
                            import ( /* webpackChunkName: "mud_property" */ '../components/page/dataClassification/drillData/mud_property.vue'),
                        meta: {
                            title: '钻井液性能'
                        }
                    }, {
                        name: 'drill_problem',
                        path: '/drill_problem',
                        component: () =>
                            import ( /* webpackChunkName: "drill_problem" */ '../components/page/dataClassification/drillData/drill_problem.vue'),
                        meta: {
                            title: '钻遇复杂情况'
                        }
                    }, {
                        name: 'log_holediameter',
                        path: '/log_holediameter',
                        component: () =>
                            import ( /* webpackChunkName: "log_holediameter" */ '../components/page/dataClassification/drillData/log_holediameter.vue'),
                        meta: {
                            title: '电测井径'
                        }
                    }, {
                        name: 'well_circle',
                        path: '/well_circle',
                        component: () =>
                            import ( /* webpackChunkName: "well_circle" */ '../components/page/dataClassification/wellPrepare/well_circle.vue'),
                        meta: {
                            title: '井筒循环'
                        }
                    }, {
                        name: 'stratum_pressure_test',
                        path: '/stratum_pressure_test',
                        component: () =>
                            import ( /* webpackChunkName: "stratum_pressure_test" */ '../components/page/dataClassification/wellPrepare/stratum_pressure_test.vue'),
                        meta: {
                            title: '地层承压实验'
                        }
                    }, { //井眼准备情况-通井（两个页面）
                        name: 'pig_drillrig',
                        path: '/pig_drillrig',
                        component: () =>
                            import ( /* webpackChunkName: "pig_drillrig" */ '../components/page/dataClassification/wellPrepare/Tsui/pig_drillrig.vue'),
                        meta: {
                            title: '通井钻具组合'
                        }
                    }, {
                        name: 'pig_result',
                        path: '/pig_result',
                        component: () =>
                            import ( /* webpackChunkName: "pig_result" */ '../components/page/dataClassification/wellPrepare/Tsui/pig_result.vue'),
                        meta: {
                            title: '通井结果'
                        }
                    }, { //固井设计-浆体设计（3个页面）
                        name: 'spacerfluid_design',
                        path: '/spacerfluid_design',
                        component: () =>
                            import ( /* webpackChunkName: "spacerfluid_design" */ '../components/page/dataClassification/wellSementDesign/slurryDesign/spacerfluid_design.vue'),
                        meta: {
                            title: '隔离液设计'
                        }
                    }, {
                        name: 'flushingfluid_design',
                        path: '/flushingfluid_design',
                        component: () =>
                            import ( /* webpackChunkName: "flushingfluid_design" */ '../components/page/dataClassification/wellSementDesign/slurryDesign/flushingfluid_design.vue'),
                        meta: {
                            title: '冲洗液设计'
                        }
                    }, {
                        name: 'cementslury_design',
                        path: '/cementslury_design',
                        component: () =>
                            import ( /* webpackChunkName: "cementslury_design" */ '../components/page/dataClassification/wellSementDesign/slurryDesign/cementslury_design.vue'),
                        meta: {
                            title: '水泥浆设计'
                        }
                    }, { //固井设计-管串设计（两个页面）
                        name: 'string_design',
                        path: '/string_design',
                        component: () =>
                            import ( /* webpackChunkName: "string_design" */ '../components/page/dataClassification/wellSementDesign/pipeDesign/string_design.vue'),
                        meta: {
                            title: '管串结构'
                        }
                    }, {
                        name: 'centralizer',
                        path: '/centralizer',
                        component: () =>
                            import ( /* webpackChunkName: "centralizer" */ '../components/page/dataClassification/wellSementDesign/pipeDesign/centralizer.vue'),
                        meta: {
                            title: '扶正器安放'
                        }
                    }, { //固井设计-施工参数设计（两个页面）
                        name: 'workflow_design',
                        path: '/workflow_design',
                        component: () =>
                            import ( /* webpackChunkName: "workflow_design" */ '../components/page/dataClassification/wellSementDesign/wellSementDesign/workflow_design.vue'),
                        meta: {
                            title: '工艺流程'
                        }
                    }, {
                        name: 'displacement_rate',
                        path: '/displacement_rate',
                        component: () =>
                            import ( /* webpackChunkName: "displacement_rate" */ '../components/page/dataClassification/wellSementDesign/wellSementDesign/displacement_rate.vue'),
                        meta: {
                            title: '顶替效率'
                        }
                    }, { //固井施工-浆体实际（3个页面）
                        name: 'spacerfluid_real',
                        path: '/spacerfluid_real',
                        component: () =>
                            import ( /* webpackChunkName: "spacerfluid_real" */ '../components/page/dataClassification/wellSementConstruction/slurryActual/spacerfluid_real.vue'),
                        meta: {
                            title: '隔离液实际'
                        }
                    }, {
                        name: 'flushingfluid_real',
                        path: '/flushingfluid_real',
                        component: () =>
                            import ( /* webpackChunkName: "spacerfluid_real" */ '../components/page/dataClassification/wellSementConstruction/slurryActual/flushingfluid_real.vue'),
                        meta: {
                            title: '冲洗液实际'
                        }
                    }, {
                        name: 'cementslury_real',
                        path: '/cementslury_real',
                        component: () =>
                            import ( /* webpackChunkName: "cementslury_real" */ '../components/page/dataClassification/wellSementConstruction/slurryActual/cementslury_real.vue'),
                        meta: {
                            title: '水泥浆实际'
                        }
                    }, {
                        name: 'workflow_real',
                        path: '/workflow_real',
                        component: () =>
                            import ( /* webpackChunkName: "workflow_real" */ '../components/page/dataClassification/wellSementConstruction/workflow_real.vue'),
                        meta: {
                            title: '实际施工参数'
                        }
                    }, {
                        name: 'work_description',
                        path: '/work_description',
                        component: () =>
                            import ( /* webpackChunkName: "work_description" */ '../components/page/dataClassification/wellSementConstruction/work_description.vue'),
                        meta: {
                            title: '施工情况说明'
                        }
                    }]
                },
                {
                    name: 'Data_Report',
                    path: '/Data_Report',
                    component: () =>
                        import ( /* webpackChunkName: "report" */ '../components/page/Data_Report.vue'),
                    meta: {
                        title: '数据报表'
                    }
                },
                {
                    path: '/icon',
                    component: () =>
                        import ( /* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: {
                        title: '自定义图标'
                    }
                },
                {
                    path: '/table',
                    component: () =>
                        import ( /* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: {
                        title: '基础表格'
                    }
                },
                {
                    path: '/tabs',
                    component: () =>
                        import ( /* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: {
                        title: 'tab选项卡'
                    }
                },
                {
                    path: '/form',
                    component: () =>
                        import ( /* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                    meta: {
                        title: '基本表单'
                    }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: {
                        title: '富文本编辑器'
                    }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () =>
                        import ( /* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                    meta: {
                        title: 'markdown编辑器'
                    }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () =>
                        import ( /* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: {
                        title: '文件上传'
                    }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () =>
                        import ( /* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: {
                        title: 'schart图表'
                    }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () =>
                        import ( /* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: {
                        title: '拖拽列表'
                    }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: {
                        title: '拖拽弹框'
                    }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () =>
                        import ( /* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: {
                        title: '国际化'
                    }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () =>
                        import ( /* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: {
                        title: '权限测试',
                        permission: true
                    }
                },
                {
                    path: '/404',
                    component: () =>
                        import ( /* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: {
                        title: '404'
                    }
                },
                {
                    path: '/403',
                    component: () =>
                        import ( /* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: {
                        title: '403'
                    }
                },
                {
                    path: '/donate',
                    component: () =>
                        import ( /* webpackChunkName: "donate" */ '../components/page/Donate.vue'),
                    meta: {
                        title: '支持作者'
                    }
                }
            ]
        }
    ]
});
